package com.zhangtai.modules.controller.admin;

import java.util.Arrays;
import java.util.Map;

import com.zhangtai.modules.entity.qw.QwCheckRuleEntity;
import com.zhangtai.modules.service.qw.QwCheckRuleService;
import com.zhangtai.utils.PageUtils;
import com.zhangtai.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;




/**
 * 
 *
 * @author wanwgei
 * @email i@weiwang.com
 * @date 2021-05-24 19:08:05
 */
@RestController
@RequestMapping("qwcheckrule")
public class QwCheckRuleController {
    @Autowired
    private QwCheckRuleService qwCheckRuleService;


    /**
     * 列表
     */
    @RequestMapping("/list")
    // @RequiresPermissions("coupon:qwcheckrule:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = qwCheckRuleService.queryPage(params);

        return R.ok(page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    // @RequiresPermissions("coupon:qwcheckrule:info")
    public R info(@PathVariable("id") Integer id){
		QwCheckRuleEntity qwCheckRule = qwCheckRuleService.getById(id);

        return R.ok(qwCheckRule);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    // @RequiresPermissions("coupon:qwcheckrule:save")
    public R save(@RequestBody QwCheckRuleEntity qwCheckRule){
		qwCheckRuleService.save(qwCheckRule);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    // @RequiresPermissions("coupon:qwcheckrule:update")
    public R update(@RequestBody QwCheckRuleEntity qwCheckRule){
		qwCheckRuleService.updateById(qwCheckRule);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    // @RequiresPermissions("coupon:qwcheckrule:delete")
    public R delete(@RequestBody Integer[] ids){
		qwCheckRuleService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
